<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="https://unpkg.com/vue@next"></script>
<div id="app">
    <todo-item v-bind="posts"></todo-item>

    <todo-item :name1="'kitty'" v-bind:age1="100"></todo-item>
</div>
<script>
    const vueOpt = {
        data(){
            return {
                posts: {
                    name1: 'kenny.bai',
                    age1: 10
                }
            }
        }
    }

    const app = Vue.createApp(vueOpt);

    app.component('todo-item', {
        data(){
            return {

            }
        },
        // props导入的是该对象的所有属性
        props:['name1', 'age1'],
        template: `
            <span>{{name1}}</span><span>{{age1}}</span><br>
        `
    });

    app.mount('#app');
</script>
</body>
</html>
